//
//  LGTrainDetailItemView.m
//  XieHeHeartDisease
//
//  Created by 1234 on 2024/2/29.
//

#import "LGTrainDetailItemView.h"

@interface LGTrainDetailItemView()

/**   */
@property (nonatomic , strong)UILabel *valueLabel;
/**   */
@property (nonatomic , strong)UILabel *titleLabel;

@end

@implementation LGTrainDetailItemView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.valueLabel];
        [self addSubview:self.titleLabel];
        [self.valueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.right.equalTo(self);
        }];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.bottom.right.equalTo(self);
        }];
    }
    return self;
}

-(void)setTitleStr:(NSString *)titleStr{
    _titleStr = titleStr;
    self.titleLabel.text = titleStr;
}

-(void)setValueStr:(NSString *)valueStr{
    _valueStr = valueStr;
    self.valueLabel.text = valueStr;
}

-(void)setAligment:(NSTextAlignment *)aligment{
    _aligment = aligment;
    self.valueLabel.textAlignment = aligment;
    self.titleLabel.textAlignment = aligment;
}

-(UILabel *)valueLabel{
    if(!_valueLabel){
        _valueLabel = [UILabel lableWithText:@"" colorString:@"#282828" textFont:LGFontWeight(18, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _valueLabel;
}

-(UILabel *)titleLabel{
    if(!_titleLabel){
        _titleLabel = [UILabel lableWithText:@"" colorString:@"#909399" textFont:LGFont(12) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _titleLabel;
}

@end
